home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / 011-020 / amok16 / memsystem / taskmemory.def < prev    next >
Text File  |  1993-11-04  |  2KB  |  53 lines

  1. (**********************************************************************
  2.  
  3.     :Program.    TaskMemory.def
  4.     :Contents.   Allocation procedures using the Task.memEntry-list
  5.     :Author.     Nicolas Benezan [bne]
  6.     :Address.    Postwiesenstr. 2, D7000 Stuttgart 60
  7.     :Phone.      711/333679
  8.     :Copyright.  Public Domain
  9.     :Language.   Modula-2
  10.     :Translator. M2Amiga AMSoft 3.11
  11.     :History.    V1.0 [bne] 12.Jan.89 (extracted from MemSystem1.1)
  12.     :Bugs.       does not handle Arts-levels perfectly if CLI-started
  13.     :Bugs.       (however, no serious malfunctions should occur)
  14.                  (don't worry, be happy !)
  15.  
  16. **********************************************************************)
  17.  
  18. DEFINITION MODULE TaskMemory;
  19.  
  20. FROM SYSTEM     IMPORT ADDRESS;
  21. FROM Exec       IMPORT MemReqSet,MemReqs;
  22.  
  23. CONST   CHIP=MemReqSet{chip,memClear};
  24.         ANY=MemReqSet{memClear};
  25.  
  26. (* - fully reentrable
  27.    - TermProcedure at level 0 only *)
  28.  
  29. PROCEDURE AllocTaskMem(byteSize:LONGINT;requirements:MemReqSet):ADDRESS;
  30. (*:Semantic.    Allocates memory and appends an entry to the
  31.   :Semantic.    memEntry-list of the task
  32.   :Note.        parameter compatible with Exec.AllocMem()
  33.   :Note.        Take GREAT CARE with PUBLIC Memory (shared by tasks)!!!
  34.   :Note.        All Memory allocated by TaskMem() will be lost when
  35.   :Note.        you call RemTask(). So be careful with public
  36.   :Note.        MsgPorts ! (Big guru is watching you) *)
  37.  
  38. PROCEDURE DeallocTaskMem(VAR Pointer:ADDRESS);
  39. (*:Input.       Pointer: Address of the memory to be deallocated
  40.   :Output.      Pointer is set to NIL
  41.   :Semantic.    Deallocates Memory blocks allocated with
  42.   :Semantic.    stem.Allocate() or MemSystem.AllocMem() *)
  43.  
  44. (*­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­*)
  45. (* The following procedures are included to be compatible with Heap     *)
  46. (*­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­*)
  47.  
  48. PROCEDURE AllocMem(VAR adr:ADDRESS;size:LONGINT;chipMem:BOOLEAN);
  49. PROCEDURE Allocate(VAR adr:ADDRESS;size:LONGINT);
  50. PROCEDURE Deallocate(VAR adr:ADDRESS);
  51.  
  52. END TaskMemory.
  53.